package com.ums.upos;

import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ServiceTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import com.ums.upos.service.DeviceServiceEngineService;
import com.ums.upos.uapi.device.logrecorder.LogRecorder;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.TimeoutException;

/**
 * Created by 白小峰 on 2018/6/27 0027.
 */

@RunWith(AndroidJUnit4.class)
public class LogRecorderTest {
   /* @Rule
    public final ServiceTestRule mServiceRule = new ServiceTestRule();
    private LogRecorder logRecorder;

    @Before
    public void init() throws TimeoutException {

        Intent intent  = new Intent(InstrumentationRegistry.getTargetContext(),DeviceServiceEngineService.class);
        IBinder binder = mServiceRule.bindService(intent);

        try {
            logRecorder = ((DeviceServiceEngineService.DeviceServiceEngineBinder) binder).getLogRecorder();

        }catch (Exception e){
            e.printStackTrace();
        }
    }

    @Test
    public void testGetState() throws RemoteException {

        Log.i("日志开关状态", ": " + logRecorder.getStatus());

    }

    @Test
    public void testOpemLogRecord() throws RemoteException {

        logRecorder.openRecorder();

    }

    @Test
    public void testCloseLogRecord() throws RemoteException {

        logRecorder.closeRecorder();

    }*/

}
